package org.springframework.cloud.netflix.feign.ribbon;

import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.Server;
import org.springframework.beans.factory.annotation.Autowired;

public class CanaryCompositeRule implements IRule {
    @Autowired
    private CanaryProperties canary;

    private final IRule originalRule;

    public CanaryCompositeRule(IRule originalRule) {
        this.originalRule = originalRule;
    }

    @Override
    public Server choose(Object key) {
        return originalRule.choose(key);
    }

    @Override
    public void setLoadBalancer(ILoadBalancer lb) {
        originalRule.setLoadBalancer(lb);
    }

    @Override
    public ILoadBalancer getLoadBalancer() {
        return originalRule.getLoadBalancer();
    }
}
